﻿namespace ACCOUNTING.LVY.Business
{
    using ACCOUNTING;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Data;
    using System.Windows.Forms;

    public class FA_TangGiamTaiSanChiTiet
    {
        private string mDiaChiThue = "";
        private string mDienGiai = "";
        private string mKhoa = "";
        private string mKhoaBoPhan = "";
        private string mKhoaChungTu = "";
        private string mKhoaDoiTuong = "";
        private string mKhoaDoiTuongThue = "";
        private string mKhoaHopDong = "";
        private string mKhoaLoaiThue = "";
        private string mKhoaSanPham = "";
        private string mKhoaTaiKhoanCo = "";
        private string mKhoaTaiKhoanNo = "";
        private string mKhoaTaiKhoanThue = "";
        private string mLoaiTien = "";
        private string mMaSoThue = "";
        private string mNgayHoaDon = "";
        private string mSoHoaDon = "";
        private string mSoSeri = "";
        private double mSoTien = 0.0;
        private double mSoTienNT = 0.0;
        private string mTenDoiTuongThue = "";
        private double mTienThue = 0.0;
        private double mTienThueNT = 0.0;
        private double mTyGia = 0.0;
        private int mTyLeThue = 0;

        public bool Save()
        {
            bool flag2;
            IDataParameter[] commandParameters = new IDataParameter[0x19];
            try
            {
                commandParameters[0] = DBHelper.createParameter("@Khoa", DbType.Int64, ParameterDirection.Input, this.mKhoa);
                commandParameters[1] = DBHelper.createParameter("@KhoaTaiSanCoDinh", DbType.Int64, ParameterDirection.Input, this.mKhoaChungTu);
                commandParameters[2] = DBHelper.createParameter("@KhoaTaiKhoanNo", DbType.Int64, ParameterDirection.Input, this.mKhoaTaiKhoanNo);
                commandParameters[3] = DBHelper.createParameter("@KhoaTaiKhoanCo", DbType.Int64, ParameterDirection.Input, this.mKhoaTaiKhoanCo);
                commandParameters[4] = DBHelper.createParameter("@KhoaDoiTuong", DbType.Int64, ParameterDirection.Input, this.mKhoaDoiTuong);
                commandParameters[5] = DBHelper.createParameter("@KhoaBoPhan", DbType.Int64, ParameterDirection.Input, this.mKhoaBoPhan);
                commandParameters[6] = DBHelper.createParameter("@KhoaSanPham", DbType.Int64, ParameterDirection.Input, this.mKhoaSanPham);
                commandParameters[7] = DBHelper.createParameter("@KhoaHopDong", DbType.Int64, ParameterDirection.Input, this.mKhoaHopDong);
                commandParameters[8] = DBHelper.createParameter("@LoaiTien", DbType.Int64, ParameterDirection.Input, this.mLoaiTien);
                commandParameters[9] = DBHelper.createParameter("@TyGia", DbType.Date, ParameterDirection.Input, this.mTyGia);
                commandParameters[10] = DBHelper.createParameter("@SoTienNT", DbType.Date, ParameterDirection.Input, this.mSoTienNT);
                commandParameters[11] = DBHelper.createParameter("@SoTien", DbType.Date, ParameterDirection.Input, this.mSoTien);
                commandParameters[12] = DBHelper.createParameter("@DienGiai", DbType.Int64, ParameterDirection.Input, this.mDienGiai);
                commandParameters[13] = DBHelper.createParameter("@KhoaTaiKhoanThue", DbType.Int64, ParameterDirection.Input, this.mKhoaTaiKhoanThue);
                commandParameters[14] = DBHelper.createParameter("@KhoaDoiTuongThue", DbType.Int64, ParameterDirection.Input, this.mKhoaDoiTuongThue);
                commandParameters[15] = DBHelper.createParameter("@TenDoiTuongThue", DbType.Int64, ParameterDirection.Input, this.mTenDoiTuongThue);
                commandParameters[0x10] = DBHelper.createParameter("@MaSoThue", DbType.Int64, ParameterDirection.Input, this.mMaSoThue);
                commandParameters[0x11] = DBHelper.createParameter("@DiaChiThue", DbType.Int64, ParameterDirection.Input, this.mDiaChiThue);
                commandParameters[0x12] = DBHelper.createParameter("@KhoaLoaiThue", DbType.Int64, ParameterDirection.Input, this.mKhoaLoaiThue);
                commandParameters[0x13] = DBHelper.createParameter("@TyLeThue", DbType.Double, ParameterDirection.Input, this.mTyLeThue);
                commandParameters[20] = DBHelper.createParameter("@TienThueNT", DbType.Date, ParameterDirection.Input, this.mTienThueNT);
                commandParameters[0x15] = DBHelper.createParameter("@TienThue", DbType.Date, ParameterDirection.Input, this.mTienThue);
                commandParameters[0x16] = DBHelper.createParameter("@SoHoaDon", DbType.Int64, ParameterDirection.Input, this.mSoHoaDon);
                commandParameters[0x17] = DBHelper.createParameter("@NgayHoaDon", DbType.Int64, ParameterDirection.Input, this.mNgayHoaDon);
                commandParameters[0x18] = DBHelper.createParameter("@SoSeri", DbType.Int64, ParameterDirection.Input, this.mSoSeri);
                bool flag = DBHelper.ExecuteNonQuery(modGeneral.ConnectionString, CommandType.StoredProcedure, "FA_sp_ChungTuTangGiamTaiSanChiTiet", commandParameters) > 0;
                flag2 = flag;
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message.ToString());
                flag2 = false;
                ProjectData.ClearProjectError();
                return flag2;
                ProjectData.ClearProjectError();
            }
            return flag2;
        }

        public string DiaChiThue
        {
            get
            {
                return this.mDiaChiThue;
            }
            set
            {
                this.mDiaChiThue = value;
            }
        }

        public string DienGiai
        {
            get
            {
                return this.mDienGiai;
            }
            set
            {
                this.mDienGiai = value;
            }
        }

        public string Khoa
        {
            get
            {
                return this.mKhoa;
            }
            set
            {
                this.mKhoa = value;
            }
        }

        public string KhoaBoPhan
        {
            get
            {
                return this.mKhoaBoPhan;
            }
            set
            {
                this.mKhoaBoPhan = value;
            }
        }

        public string KhoaChungTu
        {
            get
            {
                return this.mKhoaChungTu;
            }
            set
            {
                this.mKhoaChungTu = value;
            }
        }

        public string KhoaDoiTuong
        {
            get
            {
                return this.mKhoaDoiTuong;
            }
            set
            {
                this.mKhoaDoiTuong = value;
            }
        }

        public string KhoaDoiTuongThue
        {
            get
            {
                return this.mKhoaDoiTuongThue;
            }
            set
            {
                this.mKhoaDoiTuongThue = value;
            }
        }

        public string KhoaHopDong
        {
            get
            {
                return this.mKhoaHopDong;
            }
            set
            {
                this.mKhoaHopDong = value;
            }
        }

        public string KhoaLoaiThue
        {
            get
            {
                return this.mKhoaLoaiThue;
            }
            set
            {
                this.mKhoaLoaiThue = value;
            }
        }

        public string KhoaSanPham
        {
            get
            {
                return this.mKhoaSanPham;
            }
            set
            {
                this.mKhoaSanPham = value;
            }
        }

        public string KhoaTaiKhoanCo
        {
            get
            {
                return this.mKhoaTaiKhoanCo;
            }
            set
            {
                this.mKhoaTaiKhoanCo = value;
            }
        }

        public string KhoaTaiKhoanNo
        {
            get
            {
                return this.mKhoaTaiKhoanNo;
            }
            set
            {
                this.mKhoaTaiKhoanNo = value;
            }
        }

        public string KhoaTaiKhoanThue
        {
            get
            {
                return this.mKhoaTaiKhoanThue;
            }
            set
            {
                this.mKhoaTaiKhoanThue = value;
            }
        }

        public string LoaiTien
        {
            get
            {
                return this.mLoaiTien;
            }
            set
            {
                this.mLoaiTien = value;
            }
        }

        public string MaSoThue
        {
            get
            {
                return this.mMaSoThue;
            }
            set
            {
                this.mMaSoThue = value;
            }
        }

        public string NgayHoaDon
        {
            get
            {
                return this.mNgayHoaDon;
            }
            set
            {
                this.mNgayHoaDon = value;
            }
        }

        public string SoHoaDon
        {
            get
            {
                return this.mSoHoaDon;
            }
            set
            {
                this.mSoHoaDon = value;
            }
        }

        public string SoSeri
        {
            get
            {
                return this.mSoSeri;
            }
            set
            {
                this.mSoSeri = value;
            }
        }

        public double SoTien
        {
            get
            {
                return this.mSoTien;
            }
            set
            {
                this.mSoTien = value;
            }
        }

        public double SoTienNT
        {
            get
            {
                return this.mSoTienNT;
            }
            set
            {
                this.mSoTienNT = value;
            }
        }

        public string TenDoiTuongThue
        {
            get
            {
                return this.mTenDoiTuongThue;
            }
            set
            {
                this.mTenDoiTuongThue = value;
            }
        }

        public double TienThue
        {
            get
            {
                return this.mTienThue;
            }
            set
            {
                this.mTienThue = value;
            }
        }

        public double TienThueNT
        {
            get
            {
                return this.mTienThueNT;
            }
            set
            {
                this.mTienThueNT = value;
            }
        }

        public double TyGia
        {
            get
            {
                return this.mTyGia;
            }
            set
            {
                this.mTyGia = value;
            }
        }

        public int TyLeThue
        {
            get
            {
                return this.mTyLeThue;
            }
            set
            {
                this.mTyLeThue = value;
            }
        }
    }
}

